/******************************************************************************
 cnome: A C++ source "genes" discover. :-)

 See more details at:

   http://www.codeplex.com/cnome

 The original author site is at: http://www.alemosbarbosa.com/

 Copyright (c) 2009-2010 Alexandre Lemos Barbosa.
 Distributed under the MIT License. (See accompanying file LICENSE-MIT.txt 
 or at http://www.codeplex.com/cnome/license)
 ******************************************************************************/

#ifndef IDENTIFIER_ZONE_H
#define IDENTIFIER_ZONE_H

#include <list>

namespace cnome {
using namespace std;

class identifier_zone {
public:
	enum eIdentifierZone {
	var_use,
	type_specifier,
	var_specifier,
	};

	identifier_zone() : identifierZone(var_use), lstIdentifierZone() {}

	eIdentifierZone get_zone() const { return identifierZone; }
	void set_zone(eIdentifierZone iz) { identifierZone = iz; }
	void new_zone(eIdentifierZone iz) { 
		lstIdentifierZone.push_back(identifierZone);
		identifierZone = iz;
	}
	void old_zone() {
		identifierZone = lstIdentifierZone.back();
		lstIdentifierZone.pop_back();
	}
private:
   eIdentifierZone identifierZone;   
   list<eIdentifierZone> lstIdentifierZone;
};
}

#endif  // IDENTIFIER_ZONE_H
